﻿@model  Tuple<Himall.Model.UserInviteModel, Himall.Model.InviteRuleInfo, Himall.Model.UserMemberInfo>
<div class="container box1 lh24 expend-reg ">
  @if (!ViewBag.WeiXin)
        {
            <div class="member">成功推荐会员数：<span>@Model.Item1.InvitePersonCount</span> 个</div>
            <div class="link">邀请注册链接：<br>@Model.Item1.InviteLink  </div>

            <div class="code">专属二维码：<br><img src="@Model.Item1.QR" /></div>
            <div class="rules">
                <div class="p">
                    @MvcHtmlString.Create(Model.Item2.ShareRule)
                </div>

            </div>
        }
     else
     {
        <div class="container userinvite_bg">
            <div class="userinvite02">
                <span>邀请一个好友注册，老会员可获得@(Model.Item2.InviteIntegral.Value.ToString())积分，可用于抵扣@(ViewBag.IntergralMoney!=null?ViewBag.IntergralMoney:0) 元订单金额；新会员可获得@(Model.Item2.RegIntegral.Value.ToString())积分，多邀请多送！</span>
                <div class="share"></div>
                <div class="rules">
                    <div class="p">
                        @MvcHtmlString.Create(Model.Item2.ShareRule)
                    </div>
                </div>

            </div>
        </div>
     }
   
</div>



@if (@ViewBag.WeiXin)
{
    
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: '@ViewBag.AppId', // 必填，公众号的唯一标识
            timestamp: @ViewBag.Timestamp , // 必填，生成签名的时间戳
            nonceStr: '@ViewBag.NonceStr', // 必填，生成签名的随机串
            signature: '@ViewBag.Signature',// 必填，签名，见附录1
            jsApiList: [ 'onMenuShareTimeline' , 'onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });

        wx.ready(function () {
            // 判断当前版本是否支持指定 JS 接口，支持批量判断
            wx.checkJsApi({
                jsApiList: [ 'onMenuShareTimeline' , 'onMenuShareAppMessage' ],
                success: function (res)
                {
                    //LoadBody();
                    if(res.checkResult.onMenuShareTimeline)   //朋友圈
                    {

                    }
                    if(res.checkResult.onMenuShareAppMessage)  //朋友
                    {

                    }
                }
            });

            wx.onMenuShareAppMessage({
                title: '@Model.Item2.ShareTitle',
                desc: '@Model.Item2.ShareDesc',
                link: '@Model.Item1.InviteLink',
                imgUrl:'@Model.Item2.ShareIcon',
                type: 'link',
                dataUrl: '',
                success: function (res) {
                    // setshare();
                },
                cancel: function (res) {
                }
            });

            wx.onMenuShareTimeline({
                title: '@Model.Item2.ShareTitle',
                link: '@Model.Item1.InviteLink',
                imgUrl:'@Model.Item2.ShareIcon',
                success: function () {
                    //  setshare();
                },
                cancel: function () {

                }
            });

        });
    </script>
}